﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace eLoan.Models
{
    public class SavingsReportModel
    {
        [Display(Name = "Select a branch")]
        public IEnumerable<SelectListItem> Branches { get; set; }

        public string SelectedBranchCode { get; set; }

        [Display(Name = "Date from")]
        [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:MM/dd/yyyy}")]
        public DateTime DateFrom { get; set; }

        [Display(Name = "Date to")]
        [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:MM/dd/yyyy}")]
        public DateTime DateTo { get; set; } 

        [Display(Name = "Search text")]
        public string SearchText { get; set; }

        public string OrderBy { get; set; }

        public string Order { get; set; }

        public List<SavingsReportItem> SavingsReportItems { get; set; }

        public decimal TotalSavings { get; set; }

    }

    public class SavingsReportItem
    {
        [Display(Name = "Borrower")]
        public string BorrowerName { get; set; }

        [Display(Name = "Remarks")]
        public string Remarks { get; set; }

        [Display(Name = "Amount")]
        public decimal Amount { get; set; }

        [Display(Name = "Date Created")]
        public DateTime DateCreated { get; set; }

        [Display(Name = "Created By")]
        [StringLength(56)]
        public string CreatedBy { get; set; }
    }

}